package cn.mastor.config;

import cn.mastor.User;
import cn.mastor.server.UserService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignClientFallbackFactory implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        return new UserService() {
            @Override
            public User getUserById(Long id) {
                return new User(-1L,"介儿咯","我鸡儿咯");
            }
        };
    }
}
